<?php

namespace App\Controller\Router;

interface Parser
{
    public function match($path);
}


/*
namespace xinqdian\modules\guestbook;
use App\Controller\Router;

//@demo: http://www.youdomain.com/module_name/controller_name/action_name/pkey1/pvalue1/pkey2/pvalue2/
class Router extends Route
{
    private $_moduleKey = 'module';
    private $_controllerKey = 'controller';
    private $_actionKey = 'action';

    const URI_DELIMITER = '/';

    private $_defaults

    // return array('module' => '', 'controller' => '', 'action' => '')
    pulic function match($path)
    {
        $path = trim($path, self::URI_DELIMITER);

        $values = $params = array();

        if ('' !== $path)
        {
            $path = explode(self::URI_DELIMITER, $path);
            if (isset($path[0]))
            {
                $values[$this->_moduleKey] = array_shift($path);
            }

            if (count($path) && !empty($path[0]))
            {
                $values[$this->_controllerKey] = array_shift($path);
            }

            if (count($path) && !empty($path[0]))
            {
                $values[$this->_actionKey] = array_shift($path);
            }

            if ($num = count($path))
            {
                for ($i = 0; $i < $numSegs; $i = $i + 2) {
                    $key = urldecode($path[$i]);
                    $val = isset($path[$i + 1]) ? urldecode($path[$i + 1]) : null;
                    $params[$key] = (isset($params[$key]) ? (array_merge((array) $params[$key], array($val))): $val);
                }
            }
        }

        return $values + $params + $this->_defaults;
    }

    public function __construct(array $defauls = array(), App\Controller\Request $request = null)
    {

    }
}
*/

?>